<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "shbb_trace_growth_pic".
 *
 * @property integer $id
 * @property integer $batch_id
 * @property integer $state_id
 * @property string $path
 * @property string $introduction
 * @property string $comment
 *
 * @property ShbbBatch $batch
 */
class TraceGrowthPic extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'shbb_trace_growth_pic';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['batch_id', 'state_id'], 'integer'],
            [['introduction', 'comment'], 'string'],
            [['path'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'batch_id' => 'Batch ID',
            'state_id' => 'State ID',
            'path' => 'Path',
            'introduction' => 'Introduction',
            'comment' => 'Comment',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getBatch()
    {
        return $this->hasOne(ShbbBatch::className(), ['id' => 'batch_id']);
    }
}
